package fun.tan90.device.sink.http.plugin.model;

import fun.tan90.device.sink.core.SinkRule;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class SinkHttpRule extends SinkRule {

    /**
     * 请求地址
     */
    private String url;

    /**
     * 请求方法
     */
    private String method;

    /**
     * 请求参数
     */
    private String params;

    /**
     * 请求体
     */
    private Body body;

    /**
     * 重试策略
     */
    private Retry retry;

    /**
     * 超时配置
     */
    private Timeout timeout;

    @Setter
    @Getter
    public static class Body {

        private String type;

        private String data;
    }

    @Setter
    @Getter
    public static class Retry {

        private boolean enabled;

        private int retries;

        private int interval;
    }

    @Setter
    @Getter
    public static class Timeout {

        private int read;

        private int connect;
    }
}